from building import *

cwd = GetCurrentDir()

src = Glob('*.c')

# The set of source files associated with this SConscript file.
path = [cwd + '/..']

CPPDEFINES = ['']

#define MICROBEE_BUILD_Rover      1
#define MICROBEE_BUILD_Copter     2
#define MICROBEE_BUILD_Plane      3
#define MICROBEE_BUILD_UNKNOWN    5
#define MICROBEE_BUILD_Sub        7
#define MICROBEE_BUILD_Blimp      12
#define MICROBEE_BUILD_Heli       13

if GetDepend('MB_VEHICLE_ROVER'):
    CPPDEFINES = ['MB_VEHICLE_ROVER']
if GetDepend('MB_VEHICLE_COPTER'):
    CPPDEFINES = ['MB_VEHICLE_COPTER']
elif GetDepend('MB_VEHICLE_PLANE'):
    CPPDEFINES = ['MB_VEHICLE_PLANE']
elif GetDepend('MB_VEHICLE_SUB'):
    CPPDEFINES = ['MB_VEHICLE_SUB']
elif GetDepend('MB_VEHICLE_BLIMP'):
    CPPDEFINES = ['MB_VEHICLE_BLIMP']
elif GetDepend('MB_VEHICLE_HELI'):
    CPPDEFINES = ['MB_VEHICLE_HELI']
else:
    print(cwd)
    print('Please give vehicle type!')
    print('MB_VEHICLE_XXX needs to be defined!')
    exit(-1)

group = DefineGroup('vehicle', src, depend = [''], CPPPATH = path,CPPDEFINES = CPPDEFINES)

Return('group')
